package factorymethod

import (
	"fmt"
)

// 微信支付网关
type WechatPay struct {
	merchantID string
	apiKey     string
}

func NewWechatPay(merchantID, apiKey string) *WechatPay {
	return &WechatPay{
		merchantID: merchantID,
		apiKey:     apiKey,
	}
}

func (w *WechatPay) Pay(amount int64) (string, error) {
	// 调用微信支付接口
	return fmt.Sprintf("wechat pay %d", amount), nil
}

func (w *WechatPay) Refund(orderId string) error {
	return fmt.Errorf("wechat refund %s", orderId)
}
